<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javascript">
	//页面加载时获得并显示购物车商品的数量
	$(function (){
		$.ajax({
			url:"ShoppingCartController/getCartProductNumsByUid",
			type:"get",
			dataType:"JSON",
			success:function (data){
				if(data.code == 200){
					//写出购物车商品的数量
					var 	nums = data.msg;
					console.log(nums)
					$("#myCartNum").text(nums);
				}
			}
		})
	})
</script>

	<div class="hmtop">
			<!--顶部导航条 -->
			<div class="am-container header">
				<ul class="message-l">
					<div class="topMessage">
						<div class="menu-hd">
						<!-- 
							<a href="login.jsp" target="_top" class="h">${sessionUser.name},欢迎您！</a>
						 -->
							<c:if test="${user == null}">
								<a href="login.jsp" target="_top" class="h">亲，请登录！</a>
								<a href="register.jsp" target="_top">免费注册</a>
							</c:if>
							<c:if test="${user != null}">
								${user.userName},欢迎您！
							</c:if>
						</div>
					</div>
				</ul>
				<ul class="message-r">
					<div class="topMessage home">
						<div class="menu-hd"><a href="home.jsp" target="_top" class="h">商城首页</a></div>
					</div>
					<div class="topMessage my-shangcheng">
						<div class="menu-hd MyShangcheng"><a href="" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
					</div>
					<div class="topMessage mini-cart">
						<div class="menu-hd"><a id="mc-menu-hd" href="ShoppingCartController/myCart" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="myCartNum" style="color: red" class="h"> </strong></a></div>
					</div>
						<div class="topMessage my-shangcheng">
						<div class="menu-hd"><a href="collection.jsp" target="_top"><i class="am-icon-heart am-icon-fw"></i><span><a href="">注销帐户</a></span></a></div>
						</div>
				</ul>
				</div>

				<!--悬浮搜索框-->

				<div class="nav white">
					<div class="logo"><img src="" /></div>
					<div class="logoBig">
						<li><img src="images/indexlogo.png" /></li>
					</div>

					<div class="search-bar pr">
						<a name="index_none_header_sysc" href="#"></a>
						<form>
							<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
							<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
						</form>
					</div>
				</div>

				<div class="clear"></div>
			</div>